/* 
 * File:   Transcription.cpp
 * Author: Guilherme Monteiro
 * 
 */

#include "../headers/Transcription.h"

/**
 * Constructor of class Transcription.
 * 
 * @param text
 * @param tax
 */
Transcription::Transcription(string text, int confidence) throw (InvalidMeanTextConfidenceException) {
    setText(text);
    try {
        setMeanTextConfidence(confidence);
    }
    catch(InvalidMeanTextConfidenceException &imtce) {
        throw imtce;   
    }
}

Transcription::Transcription(const Transcription& orig) {
}

Transcription::~Transcription() {
}

/**
 * Sets the text of the transcription.
 * 
 * @param text
 */
void Transcription::setText(string text) {
    this->text = text;
}

/**
 * Returns the text of the transcription.
 * 
 * @return text
 */
string Transcription::getText() {
    return this->text;
}

/**
 * Sets the tax of the transcription.
 * 
 * @param tax
 */
void Transcription::setMeanTextConfidence(int confidence) throw (InvalidMeanTextConfidenceException) {
    if(confidence < 0 || confidence > 100) {
        throw InvalidMeanTextConfidenceException();
    }
    this->meanTextConfidence = confidence;
}

/**
 * Returns the tax of the transcription.
 * 
 * @return tax
 */
int Transcription::getMeanTextConfidence() {
    return this->meanTextConfidence;
}
